﻿using FreeSql;
using LoadClient.YUAN.C;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LoadClient.YUAN.B
{
    public class FreeSqlDB
    {

        //private readonly static string CONNECTION_STRING = "Data Source=192.168.12.200;User Id=sa;Password=123456;Initial Catalog=Serbia_L;TrustServerCertificate=true;Pooling=true;Min Pool Size=1";
        //private readonly static string CONNECTION_STRING = "Data Source=127.0.0.1;User Id=sa;Password=uatc@888;Initial Catalog=SerbiaL;TrustServerCertificate=true;Pooling=true;Min Pool Size=1";
        private readonly static string CONNECTION_STRING = COP.GetAppSettingsValue("DbBase");

        public static IFreeSql fsql00 = new FreeSqlBuilder()
               .UseConnectionString(DataType.SqlServer, CONNECTION_STRING)
               .UseAutoSyncStructure(true) //自动同步实体结构到数据库
               .UseMonitorCommand(cmd => Trace.WriteLine($"Thread_Name：{cmd.CommandText}\r\n"))
               .Build(); //请务必定义成 Singleton...单例模式192.168.124.8   

    }

}
